package cn.rkylin.oms.warehouse.stock.service;

import cn.rkylin.oms.warehouse.stock.domain.StockLog;
import cn.rkylin.oms.warehouse.stock.vo.BatchStockVO;
import cn.rkylin.oms.warehouse.stock.vo.StockVO;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * 库存服务接口
 *
 * @author liming
 * @date 2017/10/16
 */

public interface IStockService {

    /**
     * 获取库存信息
     *
     * @param entId
     * @param skuId
     * @param storId
     * @return StockVO
     * @throws Exception
     */
    public StockVO getStock(String entId, String prjId, String skuId, String storId) throws Exception;

    public List<StockVO> getSkuList(StockVO stockVO) throws Exception;

    /**
     * 更新库存
     *
     * @param stockVO 必填属性 stockVO(storId,endId,skuId,sourceId)
     * @return 影响行数
     * @throws Exception
     */
    public int updateStock(StockVO stockVO) throws Exception;

    /**
     * 更新库存
     *
     * @param stockVO 必填属性 stockVO(storId,endId,skuId,sourceId)
     * @return 影响行数
     * @throws Exception
     */
    public int updateStock2(StockVO stockVO) throws Exception;

    /**
     * 插入库存日志
     *
     * @param stockLog
     * @return
     * @throws Exception
     */
    public int insertStockLog(StockLog stockLog) throws Exception;

    /**
     * 获取未分派数
     *
     * @param entId
     * @param skuId
     * @param storId
     * @return
     */
    public int getUnallotQty(String entId, String skuId, String storId) throws Exception;

    /**
     * 获取未付款数
     *
     * @param shopId
     * @param skuId
     * @return
     */
    public int getUnpayQty(String shopId, String skuId) throws Exception;

    /**
     * queryStockList：根据查询条件获取库存信息列表. <br/>
     *
     * @param page
     * @param length
     * @param queryParamVO
     * @return
     * @throws Exception
     */
    public PageInfo<StockVO> queryStockList(int page, int length, StockVO queryParamVO) throws Exception;

    /**
     * 更新批次库存（增量）
     *
     * @param stockVO
     * @return
     * @throws Exception
     */
    public int updateBatchStock(BatchStockVO stockVO) throws Exception;

}
